package com.syan.learn.optimization.ch02.proxy;


public class DBQueryProxy implements IDBQuery {

	private DBQuery real = null;

	@Override
	public String request() {
		if (real == null) {
			real = new DBQuery();
		}
		return real.request();
	}

	public static void main(String[] args) {
		IDBQuery dbQuery = new DBQueryProxy();
		dbQuery.request();
	}

	@Override
	public String test1(String name) {
		System.out.println("hello," + name + "...");
		return null;
	}

}
